#ifndef OUTPUTIMAGEGRAPHICSVIEW_H
#define OUTPUTIMAGEGRAPHICSVIEW_H

#include <QtGui>

class OutputImageGraphicsView : public QGraphicsView {
	Q_OBJECT
public:
	OutputImageGraphicsView(QGraphicsScene&, QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0);
	~OutputImageGraphicsView();
	void clear();
	void loadImage(QImage image);
	void adjustToScrollBar(QScrollBar *scrollBar, double factor);
	QImage Image();

protected:
	void wheelEvent(QWheelEvent *event);
	//void resizeEvent ( QResizeEvent * event);
private:
	QImage myImage;
	QGraphicsPixmapItem *imageItem;
	bool hasImage;
	bool isWheelEventHappening;
	bool isLocalReason;
	qreal staticscale;

	qreal xFactor;
	qreal yFactor;
	qreal widthFactor;
	qreal heightFactor;
	QRectF mySceneRect;
	void caculatorViewEdgeInScene();
	
	public slots:
		void fitImagePartShowInNavigationGrabRect(double,double,double,double);
		void scrollBarValueChanged(int);
		void showImageByScaleInSpinBox(double);
		void loadImage(QString);
signals:
		void resetGrabRectInNavigation(double,double,double,double);
		void loadImageSignal(QImage,double);
		void scaleChanged(double);
		

};
#endif